<?php
if(!empty($_POST)){
    $year=$_POST['txt'];
    if(($year%4==0 && $year%100!=0) ||$year%400==0){
        echo "${year}是闰年";
    }else{
        echo "${year}不是闰年";
    }
}
?>
    <!DOCTYPE html>
    <html lang="en">

    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
    </head>

    <body>
        <form action="" method="POST">
            请输入年份：
            <input type="text" name="txt"><br>
            <input type="submit" value="判断闰年">
        </form>
    </body>

    </html>